import java.io.File;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wangxin
 * Date: 2024-08-02
 * Time: 16:16
 */
public class Demo5 {
    public static void main(String[] args) {
        File file = new File("./");
        scan(file);
    }

    private static void scan(File file) {
        if(!file.isDirectory()){
            return;
        }
        File[] files = file.listFiles();
        if(files == null || files.length ==0){
            return;
        }
        System.out.println(file.getAbsolutePath());
        for(File f:files){
            if(f.isFile()){
                System.out.println(f.getAbsolutePath());
            }else{
                scan(f);
            }
        }
    }
}
